package com.aaa.controller;

import com.aaa.entity.OvertimeApplication;
import com.aaa.entity.Result;
import com.aaa.service.ApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 残業申請API控制器
 * 路径前缀：/api/applications
 */
@RestController
@RequestMapping("/api/applications")
public class ApplicationController {
    @Autowired
    private ApplicationService applicationService;

    /**
     * 提交残業申請（POST）
     *
     * @param overtimeApplication 申请信息（JSON格式）
     * @return 操作结果
     */
    @PostMapping
    public Result<OvertimeApplication> submitApplication(@RequestBody OvertimeApplication overtimeApplication) {
        return applicationService.submitApplication(overtimeApplication);
    }
}